package com.example.Service;

import com.example.pojo.WechatTemplate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

import java.util.HashMap;

@Service
public class TemplateMessageService {
    private static final Logger LOGGER = LoggerFactory.getLogger(TemplateMessageService.class);

    @Autowired
    private RestTemplate restTemplate;

//    public WechatResponse sendTemplateMessage(String accessToken, WechatTemplate wechatTemplate) {
//        WechatResponse wechatResponse;
//        String url = new StringBuffer("https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=")
//                .append(accessToken).toString();
//        wechatResponse = restTemplate.postForObject(url, wechatTemplate, WechatResponse.class,new HashMap<String,String>());
//        return wechatResponse;
//    }
}
